package chapter15;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/23 10:36
 */
public class Counter implements ICounter {
    private int count;

    @Override
    public void incr() {
        synchronized (this) {
            count++;
        }
    }

    @Override
    public synchronized int getCount() {
        return count;
    }
}
